package com.seveneight.baijiesteward.bean;

import com.alibaba.fastjson.JSON;

/**
 * @author yemao
 * @date 2017/4/9
 * @description 解析实体基类!
 */

public class BaseEntity<T> {
    private static String SUCCESS_CODE = "000000";//成功的code
    private String RespCode;
    private String RespMsg;
    private String Signature;
    private T Data;

    public T getData() {
        return Data;
    }

    public void setData(T Data) {
        this.Data = Data;
    }

    public boolean isSuccess() {
        return getRespCode().equals(SUCCESS_CODE);
    }

    public String getRespCode() {
        return RespCode;
    }

    public void setRespCode(String respCode) {
        RespCode = respCode;
    }

    public String getRespMsg() {
        return RespMsg;
    }

    public void setRespMsg(String respMsg) {
        RespMsg = respMsg;
    }

    public String getSignature() {
        return Signature;
    }

    public void setSignature(String signature) {
        Signature = signature;
    }

    @Override
    public String toString() {
        return "BaseEntity{" +
                "RespCode=" + RespCode +
                ", RespMsg='" + RespMsg + '\'' +
                ", Signature='" + Signature + '\'' +
                ", Data=" + Data +
                '}';
    }

    public String toDataString() {
        return JSON.toJSONString(Data);
    }
}
